package com.lyc.user.serlvet;

import com.lyc.user.servceImpl.UserServiceImpl;
import com.lyc.user.service.UserService;

import javax.servlet.*;
import java.io.IOException;

public class UserPhoneSend implements Servlet {
    @Override
    public void init(ServletConfig servletConfig) throws ServletException {

    }

    @Override
    public ServletConfig getServletConfig() {
        return null;
    }

    @Override
    public void service(ServletRequest request, ServletResponse response) throws ServletException, IOException {
             String phone=request.getParameter("phone");

        //接收短信
        UserService userService=new UserServiceImpl();
        String result = userService.smsSend(phone);

        response.setCharacterEncoding("UTF-8");
             response.setContentType("text/html");
             response.getWriter().print(result);

    }

    @Override
    public String getServletInfo() {
        return null;
    }

    @Override
    public void destroy() {

    }
}
